package com.ruoyi.system.service.impl;

import com.ruoyi.common.core.text.Convert;
import com.ruoyi.system.domain.JiajiaActivateCity;
import com.ruoyi.system.mapper.JiajiaCityMapper;
import com.ruoyi.system.service.IJiajiaCityService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 小程序省市区Service业务层处理
 * 
 * @author knd
 * @date 2021-10-20
 */
@Service
public class JiajiaCityServiceImpl implements IJiajiaCityService
{
    @Autowired
    private JiajiaCityMapper jiajiaCityMapper;

    /**
     * 查询小程序省市区
     * 
     * @param id 小程序省市区主键
     * @return 小程序省市区
     */
    @Override
    public JiajiaActivateCity selectJiajiaCityById(Long id)
    {
        return jiajiaCityMapper.selectJiajiaCityById(id);
    }

    /**
     * 查询小程序省市区列表
     * 
     * @param jiajiaCity 小程序省市区
     * @return 小程序省市区
     */
    @Override
    public List<JiajiaActivateCity> selectJiajiaCityList(JiajiaActivateCity jiajiaCity)
    {
        return jiajiaCityMapper.selectJiajiaCityList(jiajiaCity);
    }

    /**
     * 新增小程序省市区
     * 
     * @param jiajiaCity 小程序省市区
     * @return 结果
     */
    @Override
    public int insertJiajiaCity(JiajiaActivateCity jiajiaCity)
    {
        return jiajiaCityMapper.insertJiajiaCity(jiajiaCity);
    }

    /**
     * 修改小程序省市区
     * 
     * @param jiajiaCity 小程序省市区
     * @return 结果
     */
    @Override
    public int updateJiajiaCity(JiajiaActivateCity jiajiaCity)
    {
        return jiajiaCityMapper.updateJiajiaCity(jiajiaCity);
    }

    /**
     * 批量删除小程序省市区
     * 
     * @param ids 需要删除的小程序省市区主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaCityByIds(String ids)
    {
        return jiajiaCityMapper.deleteJiajiaCityByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除小程序省市区信息
     * 
     * @param id 小程序省市区主键
     * @return 结果
     */
    @Override
    public int deleteJiajiaCityById(Long id)
    {
        return jiajiaCityMapper.deleteJiajiaCityById(id);
    }
}
